﻿<%@ Page Title="Downloads" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Downloads.aspx.cs" Inherits="CursoUNICEUB.Downloads" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <h1>
        Lista de Tutoriais.</h1>
    <hr />

    <asp:HyperLink ID="hylInserirDownload" runat="server" NavigateUrl="~/InserirTutorial.aspx"
        Text="Inserir novo tutorial" />
        <br />
        <br />
    <asp:Panel ID="Panel2" runat="server" CssClass="collapsePanelHeader" Height="30px">
        <div style="padding: 5px; cursor: pointer; vertical-align: middle;">
            <div style="float: left;">
                Filtrar os tutoriais...</div>
            <div style="float: left; margin-left: 20px;">
                <asp:Label ID="Label1" runat="server">( Mostrar Detalhes ... )</asp:Label>
            </div>
            <div style="float: right; vertical-align: middle;">
                <asp:ImageButton ID="Image1" runat="server" ImageUrl="~/Img/expand_blue.jpg" AlternateText="(Mostrar Detalhes...)" />
            </div>
        </div>
    </asp:Panel>
    <asp:Panel ID="Panel1" runat="server" CssClass="collapsePanel" Height="0">
        <br />
        <table>
            <tr>
                <td>
                    <asp:Label ID="Label3" runat="server">Busca : </asp:Label>
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtBusca" MaxLength="30" Width="150px" />
                </td>
                </tr>
                <tr>
                <td><asp:Label ID="Label2" runat="server">Assunto : </asp:Label></td>
                <td><asp:DropDownList runat="server" Width="150px" ID="ddlAssunto" DataTextField="Descricao" DataValueField="Codigo" /></td>
                <td>
                    <asp:Label ID="Label4" runat="server">Tipo : </asp:Label>
                </td>
                <td>
                    <asp:DropDownList runat="server" Width="150px" ID="ddlTipo" DataTextField="Descricao" DataValueField="Codigo"/>
                </td>
                <td><asp:Button ID="btnPesquisar" style="margin-left:20px" runat="server" 
                        Text="Pesquisar" onclick="btnPesquisar_Click" /></td>
            </tr>
        </table>
    </asp:Panel>
    <ajaxToolkit:CollapsiblePanelExtender ID="cpeDemo" runat="Server" TargetControlID="Panel1"
        ExpandControlID="Panel2" CollapseControlID="Panel2" Collapsed="True" TextLabelID="Label1"
        ImageControlID="Image1" ExpandedText="( Esconder Filtros ... )" CollapsedText="( Mostrar Filtros ... )"
        ExpandedImage="~/Img/collapse_blue.jpg" CollapsedImage="~/Img/expand_blue.jpg"
        SuppressPostBack="true" SkinID="CollapsiblePanelDemo" />
    <fieldset class="login">
        <legend>Downloads</legend>
        <asp:Repeater ID="rptDownload" runat="server">
            <ItemTemplate>
                <div runat="server" class="download" style="float: left">
                    <h1 style="color: Black">
                        <%# Eval("Titulo") %></h1>
                    <asp:ImageButton runat="server" OnClick="Download_Click" Style="float: left" ImageUrl="~/Img/download.gif"
                        CommandArgument='<%#Eval("Url")%>' />
                    <h3 style="font-weight: bold">
                        <%# Eval("Descricao") %></h3>
                    <small>
                        <%# DateTime.Parse(Eval("Data").ToString()).ToShortDateString() %> / </small>
                        <small><%# Eval("TipoDescricao") %></small>
                </div>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <div class="download" style="float: right">
                    <h1 style="color: Black">
                        <%# Eval("Titulo") %></h1>
                    <asp:ImageButton ID="ImageButton1" runat="server" OnClick="Download_Click" Style="float: left"
                        ImageUrl="~/Img/download.gif" CommandArgument='<%#Eval("Url")%>' />
                    <h3 style="font-weight: bold">
                        <%# Eval("Descricao") %></h3>
                    <small>
                        <%# DateTime.Parse(Eval("Data").ToString()).ToShortDateString()%> / </small>
                        <small><%# Eval("TipoDescricao") %></small>
                </div>
            </AlternatingItemTemplate>
        </asp:Repeater>
    </fieldset>
</asp:Content>
